package br.com.fpf.pontoapp.view.activity;

import roboguice.activity.RoboActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
import br.com.fpf.pontoapp.R;

public class MainActivity extends RoboActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.login_screen);

		final EditText matricula = (EditText) findViewById(R.id.edt_login);
		final EditText senha = (EditText) findViewById(R.id.edt_password);
		Button enviar = (Button) findViewById(R.id.btn_send);

		enviar.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				String strMatricula = matricula.getText().toString();
				String strSenha = senha.getText().toString();
				if (!strMatricula.equals("") && !strSenha.equals("")) {
					Intent intent = new Intent();
					intent.setClass(getApplicationContext(),
							TelaListaBatidas.class);
					intent.putExtra("matricula", strMatricula);
					intent.putExtra("senha", strSenha);
					startActivity(intent);
				} else {
					Toast.makeText(getApplicationContext(),
							"Matricula ou senha invalida", Toast.LENGTH_LONG)
							.show();
				}
			}
		});
	}

}
